<html>
<head>
  <title>Nabicht JSON Test</title>
  <script type="text/javascript">
    function processJSON(myJSON) {
      var html = '<ul>';
      for (var i = 0; i < myJSON.projects.length; i++) {
        var project = myJSON.projects[i];
        html += '<li>' + project.name + '<ul>';
        if (project.message.indexOf('Error') == -1) {
          html += '<li>' + 'Total commits: ' + project.totalcommits + '</li>';
          html += '<li>' + 'Last commit: ' + project.lastcommit + '</li>';
          html += '<li>' + 'First commit: ' + project.firstcommit + '</li>';
          
          html += '<li>' + 'Commits by author:' + '<ul>';
          for (var j = 0; j < project.authors.length; j++) {
            html += '<li>' + project.authors[j] + ': ' + project.revisions[j] + '</li>'; 
          }
          html += '</ul></li>';
        }
        html += '<li>' + 'Message: ' + project.message + '</li>';

        html += '</ul></li>';
      }
      html += '</ul>';
      document.getElementById("stats").innerHTML = html;
    }
</script>
</head>
<body>

<h1>Stats</h1>

<div id="stats">
</div>

<script src="http://localhost:8080/stats/json/nabicht&communical&penitentials/processJSON">
</script>

</body>
</html>
